package com.shop.trade.api.service;

import com.shop.common.model.ServiceBean;
import com.shop.common.model.param.trade.OrderBaseInput;
import com.shop.common.model.param.trade.OrderDetailInput;
import com.shop.common.model.result.trade.OrderBaseOutput;
import com.shop.common.model.result.trade.OrderDetailOutput;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 *
 * @author zhoulk
 * @date: 2019年04月05日  18:46
 */

public interface IOrderSvc {

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.initOrder
     * @Description //创建订单
     *
     * @param: itemId
     * @param: userId
     * @return com.shop.common.model.ServiceBean<java.lang.Integer>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/11 17:33
     *
     **/
    ServiceBean<Integer> initOrder(Integer itemId, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.initOrder
     * @Description //通过购物车列表创建订单
     *
     * @param: itemIds
     * @param: userId
     * @return com.shop.common.model.ServiceBean<java.util.List < java.lang.Integer>>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/7 22:12
     *
     **/
    ServiceBean<List<Integer>> initOrderByShopCart(List<Integer> itemIds, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.saveOrder
     * @Description //TODO 确认订单
     *
     * @param:
     * @return com.shop.common.model.ServiceBean 需要支付价格
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/7 22:11
     *
     **/
    ServiceBean<BigDecimal> saveOrder(List<OrderBaseInput> orderList, Boolean integral, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.qryOrderById
     * @Description //TODO 使用订单id查询订单详情
     *
     * @param: orderId
     * @return com.shop.common.model.ServiceBean<com.shop.common.model.result.trade.OrderBaseOutput>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/14 2:39
     *
     **/
    ServiceBean<OrderBaseOutput> qryOrderById(Integer orderId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.qryOrderDtail
     * @Description //TODO 查询订单详情
     *
     * @param: input
     * @return com.shop.common.model.ServiceBean<com.shop.common.model.result.trade.OrderDetailOutput>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/20 20:48
     *
     **/
    ServiceBean<OrderDetailOutput> qryOrderDtail(OrderDetailInput input);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.qryOrders
     * @Description //TODO 查询订单列表
     *
     * @param: orderBaseInput
     * @return com.shop.common.model.ServiceBean<java.util.List < com.shop.common.model.result.trade.OrderBaseOutput>>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/11 22:28
     *
     **/
    ServiceBean<List<OrderBaseOutput>> qryOrders(OrderBaseInput orderBaseInput);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.modOrder
     * @Description //TODO 修改订单
     *
     * @param: orderBaseInput
     * @return com.shop.common.model.ServiceBean<java.lang.String>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/14 2:44
     *
     **/
    ServiceBean<Integer> modOrder(OrderBaseInput orderBaseInput);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.delOrder
     * @Description //TODO 删除订单
     *
     * @param: orderId
     * @param: userId
     * @return com.shop.common.model.ServiceBean<java.lang.Integer>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/14 22:27
     *
     **/
    ServiceBean<String> delOrder(Integer orderId, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.cancelOrder
     * @Description //TODO 取消订单
     *
     * @param: orderId
     * @param: userId
     * @return com.shop.common.model.ServiceBean
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/14 22:36
     *
     **/
    ServiceBean cancelOrder(Integer orderId, String reason, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.validateOrder
     * @Description //TODO 校验订单
     *
     * @param: orderBase
     * @param: orderState
     * @return com.shop.common.model.ServiceBean<com.shop.common.model.result.trade.OrderBaseOutput>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/18 14:05
     *
     **/
    ServiceBean<OrderBaseOutput> validateOrder(Integer orderId, Integer orderState);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.checkOrder
     * @Description //订单审核
     *
     * @param: id
     * @param: type
     * @param: comment
     * @param: userId
     * @return com.shop.common.model.ServiceBean<java.lang.String>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/20 15:40
     *
     **/
    ServiceBean<String> checkOrder(Integer id, Integer state, String type, String comment, Integer userId);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.sendOrder
     * @Description //订单发货
     *
     * @param: id
     * @param: expresNo
     * @return com.shop.common.model.ServiceBean<java.lang.String>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/20 15:41
     *
     **/
    ServiceBean<String> sendOrder(Integer id, String expresNo);

    /**
     * @Function com.shop.trade.api.service.IOrderSvc.endOrder
     * @Description //TODO 确认收货
     *
     * @param: orderBaseInput
     * @return com.shop.common.model.ServiceBean<java.lang.String>
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/4/20 19:07
     *
     **/
    ServiceBean<String> endOrder(OrderBaseInput orderBaseInput);

    Map<String,Integer> qryOrderItemCount(Integer userId);
}
